﻿using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;

namespace LFSRecord2.View.Converters
{
    public class PropertyValueBrushConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool hasBoundProperty = (bool)value;
            if ((string)parameter == "Border")
            {
                if (hasBoundProperty)
                    return new SolidColorBrush(Color.FromArgb(255, 64, 64, 64));
                else
                    return new SolidColorBrush(Color.FromArgb(255, 169, 169, 169));
            }
            else
            {
                if (hasBoundProperty)
                    return new SolidColorBrush(Color.FromArgb(255, 169, 169, 169));
                else
                    return new SolidColorBrush(Color.FromArgb(255, 64, 64, 64));
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
